//
//  EquipmentDetailCell.m
//  PropertyMananger
//
//  Created by bh on 17/2/8.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "EquipmentDetailCell.h"

@implementation EquipmentDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"EquipmentDetailCellID";
    EquipmentDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if(cell == nil) {
        cell = [[EquipmentDetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    //选中cell的颜色 -无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    
    return cell;
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.nameLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.nameLabel];
        
        self.nameLabel.textColor = BHColor(102, 102, 102);
        self.nameLabel.textAlignment = NSTextAlignmentLeft;
        self.nameLabel.font = BHFont(15);
        self.nameLabel.text  = @"设备名称:";
        
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(70, 25));
        }];
        
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        
        self.titleLabel.textColor = BHColor(51, 51, 51);
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.font = BHFont(15);
        self.titleLabel.text  = @"监控摄像头";
        // self.complianManLabel.backgroundColor = BHRandColor;
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.nameLabel.mas_trailing).with.offset(0);
            make.top.equalTo(self.nameLabel).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 100, 25));
        }];

    }
    return self;
}
@end
